import nacos
import time
import requests

client = nacos.NacosClient(
    server_addresses='192.168.192.171:8848',
    namespace='public',
)

"""
nacos注册服务
"""
def nacos_register_server():
    print('开始注册服务')
    client.add_naming_instance('rga-ai-service',ip='192.168.192.204',port=5000)


"""
服务调用
"""
def server_ivocation(addr,uri,method='GET',params=None,data=None,headers=None):
    resp = requests.request(method=method,url=f'{addr}{uri}',params=params,data=data,headers=headers,timeout=6)
    return resp

